Skip to content

feat(ui): Moss group context for groups and NDOs - #181

Merged
Soushi888 merged 1 commit into
devfrom
feat/moss-group-context
Nov 4, 2026
Merged

Soushi888 merged 1 commit into
devfrom
feat/moss-group-context

Conversation

@Soushi888

@Soushi888 Soushi888 commented Nov 4, 2026 •

Copy link
Copy Markdown
Collaborator

SoushAI analysis. Drafted by Soushi's AI assistant, reviewed and posted by @Soushi888.

Summary

Inside Moss, the Moss group is now the group. The tool instance's own group cell is the one Nondominium group, joined automatically with no invite code. The profile comes from Moss (profilesClient), the role from myAccountabilitiesPerGroup(), and each new NDO is a clone created through the WeaveClient. Standalone keeps the Lobby DNA, the Group DNA and invite links, behind one seam. One open question for Soushi: NDO clones are private to the instance, not group-public, because Moss 0.16.0-rc.5 cannot register a public clone that carries DNA properties (details below).

Closes #164

Stacked on #180 (#163), which sits on #178 and #130 in the native stack #179. Review only this layer's diff; everything below belongs to the parent PRs.

Intent

Inside Moss the Moss group already holds membership and profiles, so the Lobby, the invite codes and LobbyAgentProfile would duplicate it. Decided on 2026-11-03: one Nondominium group per Moss group, namely the tool instance's group cell, joined automatically; profiles from profilesClient; roles from myAccountabilitiesPerGroup(); no work context in v0.1.0.

Changes
  • The seam. LobbyServiceResolved in lobby.service.ts is MossLobbyServiceLive when detectCurrentHost() says Moss and LobbyServiceLive otherwise. Stores, NdoService and components keep calling the same LobbyService interface.
  • moss-lobby.ts (the Moss implementation, dependencies injected so it runs in a unit test against a mocked WeaveClient): one group, id moss. The tool installer (toolInstaller) creates the GroupProfile, named after the Moss group; every other member waits for it to gossip (up to about 30 s), then joins. One resolution runs at a time and a successful one is kept, because the stores and the NDO service all ask at once and concurrent create_group and join_group commits fail with source chain head has moved (the recorded run found this). Create group, join group and invite links answer Groups are managed by Moss; the Lobby DHT calls answer with nothing.
  • moss/group-cell.ts: finds the provisioned group cell (Moss installs deferred roles as provisioned cells, see research: Moss spike, install the happ in weave dev mode and clone one NDO #162).
  • moss/profile.ts: maps the Moss profile to LobbyUserProfile, reads the roles of the instance's group, picks the strongest (Member, Steward, Progenitor).
  • moss/ndo-clone.ts and holochain.service: in Moss, NDO clones are created and enabled through the WeaveClient, since the applet client refuses clone management.
  • moss.store.svelte.ts and components: the layout loads the Moss profile instead of asking for a Lobby profile; the sidebar shows the Moss nickname and role; create group, join group, invite link, profile edit and the per-group disclosure modal are hidden inside Moss. Each is wrapped in the existing component, none is a new element beside it.
  • Docs: moss-integration.md (group context section), ui_architecture.md, IMPLEMENTATION_STATUS.md, CHANGELOG.md.
Decisions
Option Rejected because
createCloneCell(req, true) for NDO clones (decided 2026-11-03) Fails with any properties, see the open question below. PUBLIC_NDO_CLONES is a one-line constant, set to false, to flip when Moss accepts properties.
Dropping properties and encoding Layer 0 in network_seed or the first entry, to keep true Breaks the ADR-013 binding of Layer 0 to the DnaHash, a Nondominium design call that is not mine.
A new Moss-only sidebar and group view Components keep their structure; Moss hides what it replaces.
One shared GroupContext abstraction above the stores The existing LobbyService interface already is that boundary; a second one would be a parallel system.
How to test
git checkout feat/moss-group-context
nix develop -c bun run --filter ui check
nix develop -c bash -c 'cd ui && bunx vitest run --project server'
nix develop -c bun run e2e
nix develop -c bun run tool-dev          # two Moss windows

Recorded two-agent dev-mode run (2026-11-03, repo config, nested X server, driven through the tool iframes over CDP):

  1. Alice and Bob each open the tool. Both show the group Nondominium Pilot with no invite code, Alice · Progenitor and Bob · Progenitor in the sidebar (every dev agent is Progenitor), and Signed in as Alice and Signed in as Bob from the Moss profiles. No create, join or invite control is visible.
  2. Alice opens the group and creates the NDO Moss Seed Library through the form. The clone is created through the WeaveClient and anchored in the group cell.
  3. Bob reloads the tool and the card Moss Seed Library (Ideation, Commons, Physical) is in his NDO browser.
Documentation

Updated in this PR: moss-integration.md, ui_architecture.md, IMPLEMENTATION_STATUS.md, CHANGELOG.md. lobby-architecture.md §9 was marked partly superseded in #180.

Related

Open question for Soushi

NDO clones are not group-public. The decision was createCloneCell(req, true). In Moss 0.16.0-rc.5 that fails whenever the request carries modifiers.properties, which NDO clones need (ADR-013): join_cloned_cell declares properties: Option<SerializedBytes>, the renderer forwards the properties object untouched, the call fails with a Deserialize error and leaves an orphan cell (verified in the #162 spike, with the source lines). This PR creates the clone with publicToGroupMembers = false, and peers still find and join it, because the NdoAnchor in the group cell carries the clone coordinates. What is lost: an always-online node (wdocker) will not host NDO cells. Options: (1) keep it as is until Moss accepts properties (my lean, flip PUBLIC_NDO_CLONES), (2) public clone without properties and Layer 0 moved elsewhere, a design call on ADR-013, (3) ask Moss to accept a plain object in join_cloned_cell.

Pre-open review

  • Description: disclosure line first, visible Summary, details folded, Closes #164, stack position stated. Pass.
  • Merge state: in sync with feat/moss-tool-scaffold (rebased with it onto docs/161-dna-hashes), no conflicts. Pass.
  • Code: reviewed the diff. The single-flight resolution was added after the recorded run showed concurrent commits failing. The standalone LobbyServiceLive is untouched; the seam is a layer choice at module load. No blockers.
  • Documentation: the specification section, the architecture note, the status and the changelog. Pass.
  • Tests: 28 new unit tests (group cell 4, profile 9, NDO clone 5, Moss lobby service 10) against a mocked WeaveClient and a fake group cell; server project 128 passed. bun run --filter ui check: 0 errors. The client project still has the one failure that fails on chore/holochain-0.7 too.
  • Test exhaustivity: the seam (host selection, one group, installer and member paths, refusals, single-flight, clone through the WeaveClient) is covered by unit tests and by the recorded two-agent run; standalone by the unchanged e2e suite.
  • Suggestions left open: the wait for the installer's profile is 30 s; a Holochain signal would replace the polling, as the standalone code already notes.

@Soushi888
Soushi888 force-pushed the feat/moss-group-context branch from adaa947 to ae9b8bc Compare November 4, 2026 01:39
@Soushi888
Soushi888 added this pull request to stack #179 November 4, 2026 01:39
@Soushi888
Soushi888 marked this pull request as ready for review November 4, 2026 02:26
@Soushi888
Soushi888 force-pushed the feat/moss-group-context branch from ae9b8bc to 89cf3ca Compare November 4, 2026 02:45
@Soushi888
Soushi888 marked this pull request as draft November 4, 2026 03:51
@Soushi888
Soushi888 force-pushed the feat/moss-group-context branch from 89cf3ca to 41d60ff Compare November 4, 2026 03:52
Base automatically changed from feat/moss-tool-scaffold to dev November 4, 2026 04:15
Inside Moss the Moss group is the group: the tool instance's provisioned group
cell is the one Nondominium group, joined automatically with no invite code.
The profile comes from profilesClient, the role from myAccountabilitiesPerGroup,
and NDO clones are created through the WeaveClient. A layer choice in
LobbyServiceResolved keeps the Lobby DNA, Group DNA and invite codes for the
standalone build.

NDO clones are not registered as public: Moss 0.16.0-rc.5 cannot register a
clone that carries DNA properties (PUBLIC_NDO_CLONES, see #162).
@Soushi888
Soushi888 force-pushed the feat/moss-group-context branch from 41d60ff to 16b4ec2 Compare November 4, 2026 04:15
@Soushi888
Soushi888 marked this pull request as ready for review November 4, 2026 04:44
@Soushi888

Copy link
Copy Markdown
Collaborator Author

SoushAI analysis. Drafted by Soushi's AI assistant, reviewed and posted by @Soushi888.

Review APPROVE at head 16b4ec2, merging under Soushi's explicit -mwr authorisation (2026-11-03 21:42).

  • This head is the reviewed commit (89cf3ca) rebased onto dev after feat(ui): run Nondominium as a Moss tool in weave dev mode #180 merged. git range-diff shows it identical. The PR went back to draft while I rebased the stack after a conflict in feat(ui): run Nondominium as a Moss tool in weave dev mode #180, and is marked ready again now.
  • Scope as reviewed: the LobbyServiceResolved seam between MossLobbyServiceLive and LobbyServiceLive by host detection, the Moss group cell, profile and role mapping, NDO clones created through the WeaveClient, and the hidden create, join, invite and profile-edit controls inside Moss. The standalone LobbyServiceLive is untouched. 28 new unit tests.
  • CI at this head: build, rustfmt, nine Sweettest shards and e2e are SUCCESS. Retargeted to dev, clean.
  • Open question in the body, merged under the -mwr authorisation with its default: NDO clones are created with publicToGroupMembers = false because Moss 0.16.0-rc.5 cannot register a public clone that carries DNA properties. PUBLIC_NDO_CLONES is the one-line switch. Cost: an always-online node will not host NDO cells.
  • Follow-up: feat(ui): expose NDOs as Moss assets #182 retargets to dev next.

@Soushi888
Soushi888 merged commit 3095e6d into dev Nov 4, 2026
12 checks passed
@Soushi888
Soushi888 deleted the feat/moss-group-context branch November 4, 2026 04:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(moss): Moss group context for groups and NDOs

1 participant